﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Squared_Creator
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            AddTab("Start Page", "Pages\\StartPage.xaml");
        }

        public void SetTitle(string title)
        {
            this.Title = title.Trim() + " - Squared Creator";
        }



        public void AddTab(string title, string xamlFile, bool checkExisting = true)
        {
            /*if(checkExisting)
            {
                TabItem tabItem = (from TabItem item in tbc.Items
                                   where ((string)item.Header) == title
                                   select item).FirstOrDefault();
                if(tabItem != null)
                {
                    tbc.SelectedIndex = tabItem.TabIndex;
                    return;
                }
           
                TabItem ti = new TabItem();
                ti.Header = title;
                ti.Content = Application.LoadComponent(new Uri(xamlFile, UriKind.Relative));
                int i = tbc.Items.Add(ti);
                tbc.SelectedIndex = i;
            }*/
        }
    }
}
